package com.zhuzi.guicollect.utils;


import org.apache.commons.lang3.concurrent.BasicThreadFactory;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Author: MI
 * @Date: 2021/10/25/20:29
 * @Description:
 */
public class ThreadPools {
    public static ThreadPoolExecutor poolExecutor;

    static {
        ThreadFactory nameThreadFactory = new BasicThreadFactory.Builder()
                .namingPattern("basicThreadFactory-").build();
        poolExecutor = new ThreadPoolExecutor(
                1, 2, 0L, TimeUnit.MILLISECONDS,
                new ArrayBlockingQueue<Runnable>(100),
                nameThreadFactory, new ThreadPoolExecutor.AbortPolicy());
    }
}
